define(
    ["dojo/_base/declare","esri/layers/WebTiledLayer"],
    function(declare,WebTileLayer) {
        return declare(null, {
                type: null,
                //Google地图
                google_copyright: "www.google.com",
                google_subDomain: ["mt1", "mt2", "mt3"],
                googleMap:{
                    streets: "http://{subDomain}.google.cn/vt/v=w2.116&hl=zh-CN&gl=cn&x={col}&y={row}&z={level}",
                    terrain: "http://{subDomain}.google.cn/vt/lyrs=t@132,r@248000000&hl=zh-CN&gl=cn&x={col}&y={row}&z={level}",
                    imagery: "http://{subDomain}.google.cn/maps/vt?lyrs=s@189&gl=cn&x={col}&y={row}&z={level}"
                },
                //天地图
                tdt_copyright: "www.tianditu.com",
                tdt_subDomain: ["t0", "t1", "t2"],
                tdtMap:{
                    vec: "http://{subDomain}.tianditu.com/DataServer?T=vec_w&x={col}&y={row}&l={level}",
                    cva: "http://{subDomain}.tianditu.com/DataServer?T=cva_w&x={col}&y={row}&l={level}"
                },

                constructor: function(type){
                    this.type = type || "google";
                },

                getLayer:function(layer_type){
                    var url = this.type=="google"?this.googleMap[layer_type]:this.tdtMap[layer_type];
                    var copyright = this.type=="google"?this.google_copyright:this.tdt_copyright;
                    var subDomain = this.type=="google"?this.google_subDomain:this.tdt_subDomain;

                    var layer = new WebTileLayer(url, {
                        "copyright": copyright,
                        "subDomains": subDomain
                    });
                    return layer;
                }
            })
    }
);